<script setup lang="ts">
    import {ref,reactive} from 'vue'
    let cc1 = ref('儿子1-重八')
    let age = ref(18)
    //让数据暴露出去
    defineExpose({cc1,age})

    function changeMoney(p,m){
        p.minusMoney(m)
    }
</script>
<template>
    <h3>$refs-子组件1-{{ cc1 }} - 年龄:{{ age }}</h3>
    <!-- $parent - 父组件 -->
    <button @click="changeMoney($parent,10)">花爸爸的钱</button>
</template>
<style scoped>
   
</style>